import request from "@/router/axios";

export const getList = (params) => {
  return request({
    url: "/api/refundBatch/refundBatchList",
    method: "get",
    params: {
      ...params,
    },
  });
};

export const getDetail = (params) => {
  return request({
    url: "/api/orderRefund/orderRefundList",
    method: "get",
    params: {
      ...params,
    },
  });
};

export const getSonDetail = (params) => {
  return request({
    url: "/api/orderDetail/orderRefund/orderRefundList",
    method: "get",
    params: {
      ...params,
    },
  });
};
export const removeOrder = (id) => {
  return request({
    url: "/api/orderRefund/remove",
    method: "post",
    params: {
      ids: id,
    },
  });
};
export const removeMaster = (id) => {
  return request({
    url: "/api/refundBatch/remove",
    method: "post",
    params: {
      ids: id,
    },
  });
};
export const update = (row) => {
  return request({
    url: "/api/refundBatch/update",
    method: "post",
    data: row,
  });
};
export const updateRefundBatch = (id) => {
  return request({
    url: "/api/refundBatch/update",
    method: "post",
    params: {
      ids: id,
    },
  });
};

export const add = (params) => {
  return request({
    url: "/api/orderDetail/refundBatchOrderList",
    method: "get",
    params: {
      ...params,
    },
  });
};

export const saveOrderRefund = (row) => {
  return request({
    url: "/api/orderRefund/saveList",
    method: "post",
    data: row,
  });
};
export const NegativeAll = (row) => {
  return request({
    url: "/api/refundNegativeItem/saveRefundNegativeAll",
    method: "post",
    data: row,
  });
};
export const NegativeItemList = (params) => {
  return request({
    url: "/api/refundNegativeItem/NegativeItemList",
    method: "get",
   params:{
    ...params
   }
  });
};
